package org.megha.blog.example.part6;

/** A Cylinder 3-D object */
public class Cylinder extends ThreeDObject {

	private double height;
	private double radius;

	public Cylinder(double height, double radius) {
		this.height = height;
		this.radius = radius;
	}

	@Override
	public double getSurfaceArea() {
		return 2 * Math.PI * radius * (radius + height);
	}

	@Override
	public double getVolume() {
		return Math.PI * radius * radius * height;
	}

	@Override
	public String toString() {
		return "cylinder radius(" + radius + "), height(" + height + ")";
	}
}
